t
Apple Events*123*

To send Apple Events from Prograph applications you should have some familiarity with the Apple Event Object model and with the Apple Event Registry, which defines Apple Event suites and their particulars. The same applies to sending Apple Events to the Prograph Interpreter, with the addition that you could also use an Apple Event scripting environment such as Frontier to send IAC messages.

Prograph Interpreter Apple Events*123*

The Prograph Classic Interpreter supports the following Apple Events:

Required Suite*123*

Open Application

Open Document

Print Document

Quit Application

Miscellaneous Standard Suite*123*

Do Menu

Core Suite*123*

Open (for method windows)

Close (for windows )

Do Menu*124*

The direct parameter of the Do Menu Apple Event is a long integer with the menu ID in the high word and the menu item ID in the low word. Prograph menus are numbered from left to right starting at 513. The Apple menu is 512. Menu items are numbered from top to bottom, starting with 1, and including dashed lines.  Do Menu also has an optional menu name parameter which Prograph ignores.

Open Method Window*124*

To specify a method window, use an object specifier with:

 DesiredClassField = cWindow
 ContainerField = typeNull
 KeyFormField = formName
 KeyDataField = typeText

The first character of the KeyDataField indicates the type of method: 

I
instance method; 
G
get method;
S
set method; 
P
plain method. 

The rest of KeyDataField should be a string of the form “className/methodName” for a class method or “methodName” for a universal method.

Close Window*124*

To specify the window to close use an object specifier with:

 DesiredClassField = cWindow
 ContainerField = typeNull
 KeyFormField = formName
 KeyDataField = typeText

The first character of the KeyDataField is used to distinguish between different types of method windows:  “I”, instance method; “G”, get method; “S”, set method; “P”, plain method. For other windows the first character should be “ ” (space). The rest of the text of KeyDataField must exactly match the text which appears in the title bar of the window.*124*